package com.stx.test.serialize;

import java.io.*;
/**
 * 测试serialVersionUID不一致
 */
public class DeserializeDemo {
    public static void main(String[] args) {
        try (ObjectInputStream ois = new ObjectInputStream(
                new FileInputStream("D:/shuangti/user.ser"))) {
            
            User user = (User) ois.readObject();
            System.out.println("反序列化成功: " + user);
            
        } catch (IOException | ClassNotFoundException e) {
            System.err.println("反序列化失败！");
            e.printStackTrace();
        }
    }
}